<?php

namespace App\Http\Model;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    protected $table='users';
    protected $primaryKey='uid';
    protected $fillable=['uid','uname','clientid','password','gender','telphone','birthday','pic','email'];
//    public $timestamps = false;

    public function rules()
    {
        return [
            'uname'=>'required|max:8|unique:users,uname',
            'password'=>'required|min:6|max:12'
        ];
    }

    public function msg(){
        return [
            'uname.unique'=>'用户名名已存在',
            'uname.max'=>'可输入最大长度为12',
            'uname.min'=>'可输入最大长度为8',
            'uname.required'=>'用户名不能为空',
            'password.required'=>'密码不能为空',
            'password.max'=>'密码可输入最大长度为12',
            'password.min'=>'密码可输入最小长度为6'
        ];
    }
}
